<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<script src="../js/vue2.js"></script>
<body>
    <div id="app">
        输入 成绩：<input type="text" v-model="score" v-myfocus>
        <h3>你的成绩是：</h3>
        <p v-if="score>=90">A</p>
        <p v-else-if="score>=80">B</p>
        <p v-else-if="score>=70">C</p>
        <p v-else-if="score>=60">D</p>
        <p v-else>E</p>
    </div>
</body>
<script> 
    // 自定义聚焦模块
    Vue.directive("myfocus",{
        inserted(el){
            el.focus();
        }
    })
    var ms = new Vue({
        // 定义模块
        el:"#app",
        data:{
            score:'',
        }
    })
</script>
</html>